import request from "@/utils/request.js";

export const addProduceService=(data)=>{
  return request.post('/segment_schedule/createSchedules',data)
}


export const getProduceService=(data)=>{
  return request.get('/segment_schedule/getSchedules',{
    params: data,
  })
}

export const updateSchedulesService = (data) => {
  return request.put(`/segment_schedule/updateSchedules`, data);
}

export const deleteSegmentsService=(entities)=>{
  return request.post('/ship_segments/deleteSegments',{ entities })
}

/**
 * 批量导入分段施工计划（SegmentSchedule）
 * @param {Array} dataList - Excel 解析后的数据数组，每项为一个对象
 * @returns {Promise}
 */
export const importSegmentSchedulesService = (dataList) => {
  return request.post('/segment_schedule/importSchedules', { list: dataList });
};
